import React from 'react';
import { Form, Row, DatePicker, Button, Select, Input, Col, Radio, Card } from 'antd';
const FormItem = Form.Item;
const { Option } = Select;
const { RangePicker } = DatePicker

const ResultForm = ({ form: { getFieldDecorator, getFieldsValue }, isEdit, formData, titleStyle, title }) => {

  return (
    <Card title={<div style={titleStyle}>{title}</div>} bordered={false}>
      <Form layout='vertical'>
        <Row gutter={16}>
          <Col span={8}>
            <FormItem label="装配员">
              {getFieldDecorator('assemName', {
                initialValue: formData.assemName
              })(
                <Input allowClear disabled /> /* disabled={!isEdit} */
              )}
            </FormItem>
          </Col>
          <Col span={8}>
            <FormItem label="装配员填写日期">
              {getFieldDecorator('assemTime', {
                initialValue: formData.assemTime
              })(
                // <DatePicker placeholder='' style={{ width: '100%' }} disabled /> /* disabled={!isEdit} */
                <Input allowClear disabled /> /* disabled={!isEdit} */
              )}
            </FormItem>
          </Col>
          <Col span={8}>
            <FormItem label="装配组长">
              {getFieldDecorator('assemLeaderName', {
                initialValue: formData.assemLeaderName
              })(
                <Input allowClear disabled /> /* disabled={!isEdit} */
              )}
            </FormItem>
          </Col>
          <Col span={8}>
            <FormItem label="组长确认日期">
              {getFieldDecorator('assemLeaderTime', {
                initialValue: formData.assemLeaderTime
              })(
                // <DatePicker placeholder='' style={{ width: '100%' }} disabled /> /* disabled={!isEdit} */
                <Input allowClear disabled /> /* disabled={!isEdit} */
              )}
            </FormItem>
          </Col>
          <Col span={8}>
            <FormItem label="结论">
              {getFieldDecorator('checkResult', {
                initialValue: formData.checkResult,
                // rules: [
                //   {
                //     required: true,
                //     message: '请选择结果'
                //   }
                // ]
              })(
                // <Input placeholder='请输入结论' allowClear disabled={!isEdit} /> /* disabled={!isEdit} */
                <Radio.Group disabled > 
                  <Radio value={1}>合格</Radio>
                  <Radio value={2}>异常</Radio>
                </Radio.Group>
              )}
            </FormItem>
          </Col>
        </Row>
      </Form>
    </Card>
  );
};

export default Form.create()(ResultForm);
